package com.mind.customer.task;

import com.mind.customer.mapper.AjTicketTaskMapper;
import com.mind.customer.service.CustomerService;
import com.mind.system.domain.AjTicketTask;
import jakarta.annotation.Resource;
import lombok.extern.log4j.Log4j2;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Log4j2
public class TicketCustomerTask {

    @Resource
    private AjTicketTaskMapper ticketTaskMapper;


    @Resource
    private CustomerService customerService;

    /**
     * 规则检查 2秒一次
     * 2025 xp注释
     */
    @Scheduled(fixedDelay = 2000L)
    public void taskOne() {
        AjTicketTask ticketTask = ticketTaskMapper.pullTask();
        if (ticketTask == null) {
            return;
        }
        customerService.customerTicket(ticketTask);
    }


}
